\n<\/code><\/pre>\n<\/li>\nCategoryInfo : InvalidOperation: ( [Get-WmiObject], COMException<\/li>\n FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand<\/li>\n<\/ul>","upvoteCount":0,"datePublished":"2019-07-12T16:35:33.000Z","url":"https://community.spiceworks.com/t/getting-pc-name-and-serial-numbers-using-powershell/720648/4","author":{"@type":"Person","name":"bryanwi09","url":"https://community.spiceworks.com/u/bryanwi09"}},{"@type":"Answer","text":"\n\n
<\/div>\n
bryanwi09:<\/div>\n
\nI have a SonicWall 4650 that I can look into and see if it is blocking the requests.<\/p>\n<\/blockquote>\n<\/aside>\n
If those PCs are on the LAN, the sonicwall is most likely not blocking anything.<\/p>\n
When we are talking about firewalls, we are talking about the Windows Firewall on each PC. \nYou can write a GPO that enables WMI-In / WinRM<\/p>\n
Do you get that error for ALL machines?<\/p>","upvoteCount":0,"datePublished":"2019-07-12T16:37:36.000Z","url":"https://community.spiceworks.com/t/getting-pc-name-and-serial-numbers-using-powershell/720648/5","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Most of the computers are on the LAN here in the office in Louisville. I do have computers in other states that are on a different network but have SSLVPN tunnels built between the sites so that all machines can talk to the file server here in Louisville. I will look into writing a GPO to enable WinRM.<\/p>\n
Thanks a bunch!<\/p>","upvoteCount":0,"datePublished":"2019-07-12T16:40:43.000Z","url":"https://community.spiceworks.com/t/getting-pc-name-and-serial-numbers-using-powershell/720648/6","author":{"@type":"Person","name":"bryanwi09","url":"https://community.spiceworks.com/u/bryanwi09"}},{"@type":"Answer","text":"
PM me as I might be able to help. I had a script that i would run against a remote computer but if it had certain services turned off you had to force it to turn on and then could run it. You combine in some tools like PSEXEC etc from Sysinternals.<\/p>","upvoteCount":0,"datePublished":"2019-07-12T16:55:36.000Z","url":"https://community.spiceworks.com/t/getting-pc-name-and-serial-numbers-using-powershell/720648/7","author":{"@type":"Person","name":"troberts2","url":"https://community.spiceworks.com/u/troberts2"}}]}}
bryanwi09
(bryanwi09)
July 12, 2019, 4:27pm
1
I have looked through many examples online on how to get this information and have struggled to get the results I need. I am on a deadline to get an inventory of every computer for our company ASAP. Wanted to run this as a script with PowerShell to at least help me locate the ~300 computers across the company in multiple states to expedite this process. I am a noob when it comes to PowerShell I can do basic things, so bear with me.
I have a list of computer names I was able to get from our AD server into a .txt file and then a list of every available IP on our /22 network in a separate .txt file, only ~300 devices actually on the network. The closest thing I have found on here to my problem is the link below. I need the computer name and serial number from it for the device itself for warranty tracking purposes. Next year we are going to look into a solution that has software pushed out through Group Policy to fix this issue going forward.
Hi Everyone,
I’ve been working all day on this and probably wasting a lot of time. I need a powershell script that I can feed a list of IP addresses from a text file, and will return the serial number, host name, OS, and IP address in separate columns.
I’ve figured out how to find each of these specifications on my own, however, getting them into a clean format has been very difficult.
I’d be running this powershell remotely across a windows domain containing machines with Windows 2007, 2008 …
However, when I run this, every entry comes back with cannot connect to the device. If the computer is on the domain, and I have forced the PSRemoting feature as well as a trusted host for any host on the network, I think it should work and not have to worry about firewalls, but I could be wrong.
Thank you for your help in advance!
Bryan
6 Spice ups
Neally
(Neally)
July 12, 2019, 4:31pm
2
Can you please provide the exact error you are getting?
And possibly what code you are running?
I assume it is an RPC error:
common causes:
network connectivity
name resolution
Firewall / AV blocking things ← this is the most common cause
1 Spice up
Evan7191
(Evan7191)
July 12, 2019, 4:33pm
3
Do you have WinRM enabled on your workstations? You can use Test-WSMan to verify if WinRM is enabled and working.
Which OS do the workstations have? If most of them are Windows 10, then you can use Get-CimInstance, which replaced Get-WmiObject.
1 Spice up
bryanwi09
(bryanwi09)
July 12, 2019, 4:35pm
4
Sorry, thought I included that information. There is a mix with Windows 10 and 7, we are working on upgrading all the 7 machines to 10 by the end of the year. I have a SonicWall 4650 that I can look into and see if it is blocking the requests.
Collecting information from NEWPC3
Error communicating with NEWPC3, skipping to next
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:12 char:19
$Serial = Get-WmiObject -Class Win32_Bios -ComputerName $ComputerName |
CategoryInfo : InvalidOperation: ( [Get-WmiObject], COMException
FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Neally
(Neally)
July 12, 2019, 4:37pm
5
If those PCs are on the LAN, the sonicwall is most likely not blocking anything.
When we are talking about firewalls, we are talking about the Windows Firewall on each PC.
You can write a GPO that enables WMI-In / WinRM
Do you get that error for ALL machines?
bryanwi09
(bryanwi09)
July 12, 2019, 4:40pm
6
Most of the computers are on the LAN here in the office in Louisville. I do have computers in other states that are on a different network but have SSLVPN tunnels built between the sites so that all machines can talk to the file server here in Louisville. I will look into writing a GPO to enable WinRM.
Thanks a bunch!
troberts2
(troberts2)
July 12, 2019, 4:55pm
7
PM me as I might be able to help. I had a script that i would run against a remote computer but if it had certain services turned off you had to force it to turn on and then could run it. You combine in some tools like PSEXEC etc from Sysinternals.